package com.itlong.cloud.resource;

import com.itlong.cloud.iot.service.server.AliIotServerService;
import com.itlong.cloud.iottp.IIotServerServiceClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <desc>
 *      云设备业务处理暴露接口实现类
 * </desc>
 *
 * @createDate 2019/04/04
 */
@RestController
public class IotDeviceServiceResource implements IIotServerServiceClient{
    @Autowired
    AliIotServerService aliIotServerService;

    /**
     * <desc>
     *     批量获取同一个产品型号下的设备工作状态
     * </desc>
     *
     * @param productKey
     * @param deviceUniques 设备序列号 多个,号分隔
     * @return
     * @author Jiaqi.X
     * @createDate  2018/03/17
     */
    @Override
    @RequestMapping(path = "/iotTp/iot/batchGetDeviceState",method = RequestMethod.POST)
    public String batchGetDeviceState(@RequestParam("productKey") String productKey,@RequestParam("deviceUnique") String deviceUniques) {
        return aliIotServerService.batchGetDeviceState(productKey,deviceUniques);
    }
}
